home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / wwbbs31_source.lha / WWBBS / RxSrc / simplerexx.h < prev    next >
C/C++ Source or Header  |  1994-08-16  |  3KB  |  115 lines

  1. /*
  2.  * Simple ARexx interface by Michael Sinz
  3.  *
  4.  * This is a very "Simple" interface...
  5.  */
  6.  
  7. #ifndef    SIMPLE_REXX_H
  8. #define    SIMPLE_REXX_H
  9.  
  10. #include    <exec/types.h>
  11. #include    <exec/nodes.h>
  12. #include    <exec/lists.h>
  13. #include    <exec/ports.h>
  14.  
  15. #include    <rexx/storage.h>
  16. #include    <rexx/rxslib.h>
  17.  
  18. /*
  19.  * This is the handle that SimpleRexx will give you
  20.  * when you initialize an ARexx port...
  21.  *
  22.  * The conditional below is used to skip this if we have
  23.  * defined it earlier...
  24.  */
  25. #ifndef    AREXXCONTEXT
  26.  
  27. typedef void *AREXXCONTEXT;
  28.  
  29. #endif    /* AREXXCONTEXT */
  30.  
  31. /*
  32.  * The value of RexxMsg (from GetARexxMsg) if there was an error returned
  33.  */
  34. #define    REXX_RETURN_ERROR    ((struct RexxMsg *)-1L)
  35. #define REXX_RETURN_OK    ((struct RexxMsg *)-2L)
  36.  
  37. /*
  38.  * This function closes down the ARexx context that was opened
  39.  * with InitARexx...
  40.  */
  41. void FreeARexx(AREXXCONTEXT);
  42.  
  43. /*
  44.  * This routine initializes an ARexx port for your process
  45.  * This should only be done once per process.  You must call it
  46.  * with a valid application name and you must use the handle it
  47.  * returns in all other calls...
  48.  *
  49.  * NOTE:  The AppName should not have spaces in it...
  50.  *        Example AppNames:  "MyWord" or "FastCalc" etc...
  51.  *        The name *MUST* be less that 16 characters...
  52.  *        If it is not, it will be trimmed...
  53.  *        The name will also be UPPER-CASED...
  54.  *
  55.  * NOTE:  The Default file name extension, if NULL will be
  56.  *        "rexx"  (the "." is automatic)
  57.  */
  58. AREXXCONTEXT InitARexx(char *,char *);
  59.  
  60. /*
  61.  * This function returns the port name of your ARexx port.
  62.  * It will return NULL if there is no ARexx port...
  63.  *
  64.  * This string is *READ ONLY*  You *MUST NOT* modify it...
  65.  */
  66. char *ARexxName(AREXXCONTEXT);
  67.  
  68. /*
  69.  * This function returns the signal mask that the Rexx port is
  70.  * using.  It returns NULL if there is no signal...
  71.  *
  72.  * Use this signal bit in your Wait() loop...
  73.  */
  74. ULONG ARexxSignal(AREXXCONTEXT);
  75.  
  76. /*
  77.  * This function returns a structure that contains the commands sent from
  78.  * ARexx...  You will need to parse it and return the structure back
  79.  * so that the memory can be freed...
  80.  *
  81.  * This returns NULL if there was no message...
  82.  */
  83. struct RexxMsg *GetARexxMsg(AREXXCONTEXT);
  84.  
  85. /*
  86.  * Use this to return a ARexx message...
  87.  *
  88.  * If you wish to return something, it must be in the RString.
  89.  * If you wish to return an Error, it must be in the Error.
  90.  */
  91. void ReplyARexxMsg(AREXXCONTEXT,struct RexxMsg *,char *,LONG);
  92.  
  93. /*
  94.  * This function will send a string to ARexx...
  95.  *
  96.  * The default host port will be that of your task...
  97.  *
  98.  * If you set StringFile to TRUE, it will set that bit for the message...
  99.  *
  100.  * Returns TRUE if it send the message, FALSE if it did not...
  101.  */
  102. short SendARexxMsg(AREXXCONTEXT,char *,short);
  103.  
  104. /*
  105.  * This function will set an error string for the ARexx
  106.  * application in the variable defined as <appname>.LASTERROR
  107.  *
  108.  * Note that this can only happen if there is an ARexx message...
  109.  *
  110.  * This returns TRUE if it worked, FALSE if it did not...
  111.  */
  112. short SetARexxLastError(AREXXCONTEXT,struct RexxMsg *,char *);
  113.  
  114. #endif    /* SIMPLE_REXX_H */
  115.